<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
</head>
<body>
    <script >
      /**
       *  对象方法扩展
       * 
       * -Object.is 判断两个值是否完全相同
       * -Object.assign 对象的合并
       * -Object.setPrototypeOf Object.getPrototypeof
      */

        console.log(Object.is(120,120));// true
        console.log(Object.is(NaN,NaN));// true
        console.log(NaN === NaN);// false

        const config1 = {
            host:'123',
            port:1232
        }
        const config2 = {
            port:123
        }
        // 后面覆盖前面的，相同就覆盖，没有就添加
        Object.assign(config1,config2);

        // 设置原型对象
        const school = {name:'pop'}
        const cities={xiaohao:['背景']}
        // 将后面的原型对象赋值给前面的
        Object.setPrototypeOf(school,cities);
        console.log(school);
        
    </script>

</body>

</html>